<!---
	@author: 		juan Llanes <juanllanes@gmail.com>
	@version:		0.1
--->
<cfcomponent 
	output="false"
	alias="src.com.DAC.confluence.model.ModelVO">
		
	<cfproperty name="id" type="numeric" default="0"/>
		
	<cfscript>
		variables.attributes = Structnew();
	</cfscript>
	
	

	<cffunction name="init" output="false" returntype="ModelVO">
		<cfreturn this>
	</cffunction>
	
	
	<cffunction 
		name="getter" 
		output="false" 
		access="public" 
		returntype="any">
		
		<cfargument name="variable" required="yes" type="string">
		<cftry>
			<cfif StructKeyExists(variables.attributes,arguments.variable)>
				<cfreturn variables[#arguments.variable#]>
			<cfelse>
				<cfthrow 
					errorcode="MODEL_00" 
					detail="attribute #arguments.variable# no exist" />
			</cfif>
			
			<cfcatch type="any">
				<cfthrow 
					errorcode="#cfcatch.ErrorCode#" 
					detail="#cfcatch.Detail#" />
			</cfcatch>
		</cftry>
	</cffunction>

	<cffunction 
		name="setter" 
		output="false" 
		access="public" 
		returntype="void">
		
		<cfargument 
			name="variable" 
			required="true" 
			type="string">
		
		<cfargument 
			name="value" 
			type="any" 
			required="yes">
		<cftry>
			<cfif StructKeyExists(variables.attributes,arguments.variable)>
				<cfset variables[arguments.variable] = arguments.value>
			<cfelse>
				<cfthrow 
					errorcode="MODEL_00" 
					detail="attribute #arguments.variable# no exist" />
			</cfif>
			<cfcatch type="any">
				<cfthrow 
					errorcode="#cfcatch.ErrorCode#" 
					detail="#cfcatch.Detail#" />
			</cfcatch>
		</cftry>
		
	</cffunction>

</cfcomponent>